package com.sample.library.portlet.util;

import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;

public class Constant {
	public static final String DEFAULT_RESOURCEBUNDER = "/content/languages/Language-listcontents";
	
	public static final float MILLIMETERTOPOINT = 2.834645669f;
	public static final String newline = System.getProperty("line.separator");
	public static final String slash = System.getProperty("file.separator");
	
	public static final  DecimalFormat text2Format = new DecimalFormat("#00");
	
	public static final String FORMATDATE_DD_MM_YYYY_STR = "dd/MM/yyyy";
	public static final DateFormat FORMATDATE_YYYY = new SimpleDateFormat("yyyy");
	public static final DateFormat FORMATDATE_DD_MM_YYYY = new SimpleDateFormat("dd/MM/yyyy");
	public static final DateFormat FORMATDATE_dd_MM_yyyy_H_mm = new SimpleDateFormat("ddMMyyyy H-mm");
	public static final DateFormat FORMATDATE_DD_MM_YYYY_FOR_EXPORT = new SimpleDateFormat("yyyyMMdd");
	public static final DateFormat FORMATDATE_yyyy_MM_dd_HH_mm_ss = new SimpleDateFormat("yyyyMMddHHmmss");
	public static final DateFormat FORMATDATE_dd_MM_yyyy_HH_mm_ss_a = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss a");

	public static final String EXPORT_FOLDER_SOURCE = "C:/tmp/";
	public static final String EXPORT_FOLDER_DESTINATION = "smsData";
	
	public static final Locale DEFAULT_LOCAL = new Locale("vi", "VN");//Locale.ENGLISH;
	
	public static final String RELATIVE_ERROR_TEMPLATE_FOLDER = "error_templates";
	public static final String RELATIVE_ERROR_FOLDER = "ImportError";
	public static final String RELATIVE_ERROR_FOLDER_IMPORT_ORG = "ImportError/LoiNhapDonVi";
	public static final String RELATIVE_REPORT_FOLDER = "reports";
	public static final String EXTENTION_ERROR_FILE = ".xls";
	
	public static final String DEFAULT_RENEWAL_NAME = "ImportData_";
	
	public static final int NUMBER_OF_RECORD_PER_TIMES = 3000;
	public static final int NUMBER_OF_RECORD_IN_EXEL_FILE = 30000;
	
	public static final String ORDER_BY_TYPE_DES = "D";
	public static final String ORDER_BY_TYPE_ASC = "A";
	
	public static final String PRINT_ALL = "00";
	public static final String PRINT_NO	= "01";
	public static final String PRINT_YES = "02";
	
	public static final Boolean ACTIVE_NO	= Boolean.FALSE;
	public static final Boolean ACTIVE_YES	= Boolean.TRUE;
	
	public static final Boolean CURRENT_NO	= Boolean.FALSE;
	public static final Boolean CURRENT_YES	= Boolean.TRUE;
	
	public static final Boolean SEX_MALE	= Boolean.TRUE;
	public static final Boolean SEX_FEMALE	= Boolean.FALSE;

	public static final int DATE_TYPE_MONTH = 0; 
	public static final int DATE_TYPE_QUATER = 1; 
	public static final int DATE_TYPE_HAFTYEAR = 2;
	public static final int DATE_TYPE_YEAR = 3; 
	
	public static NumberFormat VIETNAM_CURRENCY_FORMAT;
	static {
		Locale vnLocale = new Locale("vi", "VN");
		//VIETNAM_CURRENCY_FORMAT = NumberFormat.getCurrencyInstance(vnLocale);
		VIETNAM_CURRENCY_FORMAT = NumberFormat.getNumberInstance(vnLocale);
		VIETNAM_CURRENCY_FORMAT.setMaximumFractionDigits(0);
		VIETNAM_CURRENCY_FORMAT.setMinimumFractionDigits(0);
		
	};
	

	public static final int MIN_YEAR = 1754;
	public static final int MAX_YEAR = 9999;
	
	public static final double NUM_DAYS_PER_MONTH = 30D;

	public static final int NOTICE_LENGHT = 80;
	
	
	public static final String EMAIL_REGEXP = "[\\w-]+@([\\w-]+\\.)+[\\w-]+";
		//       "/^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i";

	public static final String PHONE_REGEXP ="^[-,]?[0-9]*\\.?[0-9]+$";
	// "/(\\({0,1})(\\d{3})(\\){0,1})(\\s|-)*(\\d{3})(\\s|-)*(\\d{4})/";
	
	public static final String YEAR_REGEXP = "^\\d{4}";
	public static final  DecimalFormat text5Format = new DecimalFormat("#00000");
	public static final  DecimalFormat text3Format = new DecimalFormat("#000");

	public static final String PORTLET_USER_DEFAULT_PASS = "test";

	public static final String PORTLET_USER_DEFAULT = "test@liferay.com";

	public static final int PERIOD_DAY = 1;
	public static final int PERIOD_QUATER = 2;
	public static final int PERIOD_HAFTYEAR = 3;
	public static final int PERIOD_YEAR = 4;

}
